﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 通用附件表
	/// </summary>
	[Serializable]
	[Table("Sys_Attachment")]
	public partial class Sys_Attachment
	{
		/// <summary>
		/// 
		/// </summary>
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 相关联的表名
		/// <see cref="ST.Buz.Base.Enums.TableCode"/>
		/// </summary>
		[Column("TableID")]
		public int TableID { get; set; }

		/// <summary>
		/// 相关联的表名
		/// </summary>
		[Column("TableName")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		[Description("相关联的表名")]
		public string TableName { get; set; }

		/// <summary>
		/// 相关联的表ID
		/// </summary>
		[Column("InfoID")]
		public int InfoID { get; set; }

		/// <summary>
		/// 文件类别
		/// </summary>
		[Column("FileType")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string FileType { get; set; }

		/// <summary>
		/// 原始文件名
		/// </summary>
		[Column("SrcName")]
		[StringLength(150, ErrorMessage = "{0}长度不能超过{1}")]
		public string SrcName { get; set; }

		/// <summary>
		/// 文件大小
		/// </summary>
		[Column("FileSize")]
		public long FileSize { get; set; }

		/// <summary>
		/// 文件名称
		/// </summary>
		[Column("FileName")]
		[StringLength(150, ErrorMessage = "{0}长度不能超过{1}")]
		public string FileName { get; set; }

		/// <summary>
		/// 文件链接
		/// </summary>
		[Column("FileUrl")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string FileUrl { get; set; }

		/// <summary>
		/// 文件描述
		/// </summary>
		[Column("FileDesc")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string FileDesc { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }

		/// <summary>
		/// 
		/// </summary>
		[Column("OrgID")]
		[JsonIgnore]
		public int OrgID { get; set; }
	}
}
